#@layout()
#define content()

<section class="content-header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6">

                <div class="row mb-2">
                    <div class="col-sm-12">
                        <h1>
                            #(flowTemplate ? '编辑' : '新建')流程
                            <small data-toggle="tooltip" title="" data-placement="right"
                                   data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                            <small> 首页 / 审核 / 流程管理 /  #(flowTemplate ? '编辑' : '新建')流程</small>
                        </h1>
                    </div>
                </div>
            </div>

        </div>

    </div><!-- /.container-fluid -->
</section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">

                    <form class="autoAjaxSubmit form-setting" autocomplete="off"
                          action="#(CPATH)/admin/flow/doSaveTemplate"
                          data-ok-href="#(CPATH)/admin/flow/template"
                          data-ok-message="审核流程保存成功"
                          method="POST"
                    >
                        <input type="hidden" name="flowTemplate.id" value="#(flowTemplate.id ??)">
                        <div class="card-body">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label"><span class="text-danger mr-2">*</span> 名称</label>
                                <div class="col-sm-6">
                                    <input type="text" name="flowTemplate.title" class="form-control" value="#(flowTemplate.title ??)" required
                                           placeholder="建议设置一个直观的、不需要解释的流程名称">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">流程类型</label>
                                <div class="col-sm-6">
                                    <select class="form-control" name="flowTemplate.type">
                                        #for(entry : flowTypeMap)
                                        <option value="#(entry.key ??)" #selectedIf(flowTemplate && flowTemplate.type == entry.key)>#(entry.value.title ??)</option>
                                       #end
                                    </select>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">描述</label>
                                <div class="col-sm-6">
                                    <textarea rows="5" name="flowTemplate.description" class="form-control"
                                              placeholder="该流程的一些描述 或 备注">#(flowTemplate.description ??)</textarea>
                                </div>
                            </div>

                        </div>
                        <!-- /.card-body -->
                        <div class="card-footer">
                            <div class="offset-sm-2 col-sm-10 submit-block">
                                <div class="card-submit">
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.card-footer -->
                    </form>
                </div>
            </div>

    </section>
#end
